]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
volume: Don't have a separate syncVisibility method
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 20 Dec 2012 03:46:11 +0000 (22:46 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 21 Dec 2012 17:30:03 +0000 (12:30 -0500)
With it doing less now, we can simply do it inline.

https://bugzilla.gnome.org/show_bug.cgi?id=690539

js/ui/status/volume.js

index 9f65d71eb89a05040ca1785af7813cc5a37afbff..859b403ca2f699ba7edf0fa3df09c5f555c460c8 100644 (file)
@@ -228,12 +228,11 @@ const Indicator = new Lang.Class({
         this._volumeMenu = new VolumeMenu(this._control);
         this._volumeMenu.connect('icon-changed', Lang.bind(this, function(menu) {
             let icon = this._volumeMenu.getIcon();
-            this._hasPulseAudio = icon != null;
+            this.actor.visible = (icon != null);
             this.setIcon(icon);
-            this._syncVisibility();
         }));
         this._volumeMenu.connect('headphones-changed', Lang.bind(this, function() {
-            this._syncVisibility();
+            this._headphoneIcon.visible = this._volumeMenu.hasHeadphones;
         }));
 
         this._headphoneIcon = this.addIcon(new Gio.ThemedIcon({ name: 'headphones-symbolic' }));
@@ -247,11 +246,6 @@ const Indicator = new Lang.Class({
         this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
     },
 
-    _syncVisibility: function() {
-        this.actor.visible = this._hasPulseAudio;
-        this._headphoneIcon.visible = this._volumeMenu.hasHeadphones;
-    },
-
     _onScrollEvent: function(actor, event) {
         this._volumeMenu.scroll(event);
     }